/*
 * MainMenu.java
 *
 * Created on Jun 15, 2011, 2:06:31 PM
 */
package ui.gui;

import javax.swing.JFrame;

/**
 *
 * @author k4emic
 */
public class MainMenu extends javax.swing.JFrame {

    /** Creates new form MainMenu */
    public MainMenu() {
        setSize(200, 200);
        setLocationRelativeTo(null);
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuBar1 = new javax.swing.JMenuBar();
        saleMenu = new javax.swing.JMenu();
        newSaleMenu = new javax.swing.JMenuItem();
        saleHistoryMenu = new javax.swing.JMenuItem();
        customerMenu = new javax.swing.JMenu();
        customerItem = new javax.swing.JMenuItem();
        itemMenu = new javax.swing.JMenu();
        itemMenuItem = new javax.swing.JMenuItem();
        systemMenu = new javax.swing.JMenu();
        exitMenu = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        saleMenu.setText("Salg");

        newSaleMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        newSaleMenu.setText("Nyt salg");
        newSaleMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newSaleMenuActionPerformed(evt);
            }
        });
        saleMenu.add(newSaleMenu);

        saleHistoryMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.CTRL_MASK));
        saleHistoryMenu.setText("Salgs historik");
        saleHistoryMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saleHistoryMenuActionPerformed(evt);
            }
        });
        saleMenu.add(saleHistoryMenu);

        jMenuBar1.add(saleMenu);

        customerMenu.setText("Kunder");

        customerItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_K, java.awt.event.InputEvent.CTRL_MASK));
        customerItem.setText("Kunder");
        customerItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                customerItemActionPerformed(evt);
            }
        });
        customerMenu.add(customerItem);

        jMenuBar1.add(customerMenu);

        itemMenu.setText("Varer");

        itemMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.CTRL_MASK));
        itemMenuItem.setText("Varer");
        itemMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemMenuItemActionPerformed(evt);
            }
        });
        itemMenu.add(itemMenuItem);

        jMenuBar1.add(itemMenu);

        systemMenu.setText("System");

        exitMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.CTRL_MASK));
        exitMenu.setText("Afslut");
        exitMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitMenuActionPerformed(evt);
            }
        });
        systemMenu.add(exitMenu);

        jMenuBar1.add(systemMenu);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 318, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 182, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void exitMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuActionPerformed
        System.exit(0);
    }//GEN-LAST:event_exitMenuActionPerformed

    private void newSaleMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newSaleMenuActionPerformed
        JFrame frame = new NewSaleFrame();
        frame.setLocationRelativeTo(this);
        frame.setVisible(true);
    }//GEN-LAST:event_newSaleMenuActionPerformed

    private void customerItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_customerItemActionPerformed
        JFrame frame = new CustomerFrame();
        frame.setLocationRelativeTo(this);
        frame.setVisible(true);
    }//GEN-LAST:event_customerItemActionPerformed

    private void itemMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemMenuItemActionPerformed
        JFrame frame = new ItemFrame();
        frame.setLocationRelativeTo(this);
        frame.setVisible(true);
    }//GEN-LAST:event_itemMenuItemActionPerformed

    private void saleHistoryMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saleHistoryMenuActionPerformed
        JFrame frame = new SalesHistoryFrame();
        frame.setLocationRelativeTo(this);
        frame.setVisible(true);
    }//GEN-LAST:event_saleHistoryMenuActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem customerItem;
    private javax.swing.JMenu customerMenu;
    private javax.swing.JMenuItem exitMenu;
    private javax.swing.JMenu itemMenu;
    private javax.swing.JMenuItem itemMenuItem;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem newSaleMenu;
    private javax.swing.JMenuItem saleHistoryMenu;
    private javax.swing.JMenu saleMenu;
    private javax.swing.JMenu systemMenu;
    // End of variables declaration//GEN-END:variables
}
